package edu.cuit.avatar.loop;

/**
 * 打印出101年到2100年之间所有的闰年，每行打印10个，每个以制表符进行分割
 */
public class PrintLeapYear {
    public static void main(String[] args) {
        final int NUMBER_OF_LINE = 10;
        int count = 0;
        for(int year = 101; year <= 2100; year++){
//            if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0){
//                System.out.print(year + "\t");
//                count++;
//                if(count % NUMBER_OF_LINE == 0)
//                    System.out.println();
//            }

            if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0){
                count++;
                System.out.print(year + (count % NUMBER_OF_LINE == 0 ? "\r\n" : "\t"));
            }
        }
    }
}
